cups: Warn only once if colord is not available
authorMatthias Clasen <mclasen@redhat.com>
Sun, 17 Dec 2017 22:09:55 +0000 (17:09 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 17 Dec 2017 22:11:27 +0000 (17:11 -0500)
No need to keep complaining about this.

https://bugzilla.gnome.org/show_bug.cgi?id=791650

modules/printbackends/cups/gtkprintercups.c

index 068aba74c5d023724d501361bc52b08455f0f18c..525382aa8a795293160a6d58e98f4b8218132217 100644 (file)
@@ -539,12 +539,17 @@ colord_client_connect_cb (GObject *source_object,
   gboolean ret;
   GError *error = NULL;
   GtkPrinterCups *printer = GTK_PRINTER_CUPS (user_data);
+  static gboolean colord_warned = FALSE;
 
   ret = cd_client_connect_finish (CD_CLIENT (source_object),
                                   res, &error);
   if (!ret)
     {
-      g_warning ("failed to contact colord: %s", error->message);
+      if (!colord_warned)
+        {
+          g_warning ("failed to contact colord: %s", error->message);
+          colord_warned = TRUE;
+        }
       g_error_free (error);
     }